package com.example.designpattern.lazyloading;

import lombok.extern.slf4j.Slf4j;

/**
 * 简单的实现懒加载，但是线程不安全
 */
@Slf4j
public class HolderSimple {

  private Gift gift;

  public HolderSimple() {
  }

  public Gift getHeavy() {
    if (gift == null) {
      gift = new Gift();
    }
    return gift;
  }

}
